<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
    <title>Title</title>
</head>
<body>
<a href="addLog.jsp">添加物流信息</a>
<table width="1000px" border="1px">
    <tr>
        <th>物流编号</th>
        <th>物流货物</th>
        <th>开始时间</th>
        <th>结束时间</th>
        <th>开始地址</th>
        <th>收货地址</th>
        <th>数量</th>
        <th>操作</th>
    </tr>
    <c:forEach var="l" items="${logistics}">
        <tr>
            <td>${l.id}</td>
            <td>${l.good.goodName}</td>
            <td>${l.startTime}</td>
            <td>${l.endTime}</td>
            <td>${l.startAddress.addressShen}省${l.startAddress.addressShi}市${l.startAddress.addressQu}区</td>
            <td>${l.endAddress.addressShen}省${l.endAddress.addressShi}市${l.endAddress.addressQu}区</td>
            <td>${l.amount}</td>
            <td>
                <a href="/findLogById?id=${l.id}">更新</a>
                <a href="javascript:if(confirm('是否确认删除？'))location.href='/removeLog?id=${l.id}'">删除</a>
            </td>
        </tr>
    </c:forEach>
</table>


<nav aria-label="Page navigation">
    <ul class="pagination">
        <c:choose>
            <c:when test="${page.current>1}">
                <li>
                    <a href="Commodity.do?m=findPage&current=${page.current-1}" aria-label="Previous">
                        <span aria-hidden="true">&laquo;</span>
                    </a>
                </li>
            </c:when>
            <c:otherwise>
                <li class="disabled">
                    <a aria-label="Previous">
                        <span aria-hidden="true">&laquo;</span>
                    </a>
                </li>
            </c:otherwise>
        </c:choose>



        <c:forEach var="i" begin="1" end="${page.pages}" step="1">
            <li class="${page.current==i?'active':''}"><a href="Commodity.do?m=findPage&current=${i}">${i}</a></li>
        </c:forEach>

        <c:choose>
            <c:when test="${page.current<page.pages}">
                <li>
                    <a href="Commodity.do?m=findPage&current=${page.current+1}" aria-label="Next">
                        <span aria-hidden="true">&raquo;</span>
                    </a>
                </li>
            </c:when>
            <c:otherwise>
                <li class="disabled">
                    <a  aria-label="Next">
                        <span aria-hidden="true">&raquo;</span>
                    </a>
                </li>
            </c:otherwise>
        </c:choose>

    </ul>
</nav>

<script src="./layui/layui.js"></script>
<!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery，所以必须放在前边) -->
<script src="https://cdn.jsdelivr.cn/npm/jquery@1.12.4/dist/jquery.min.js" integrity="sha384-nvAa0+6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ" crossorigin="anonymous"></script>
<!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
<script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"></script>
</body>
</html>